﻿<%@ Page Title="" Language="C#" MasterPageFile="~/System/MasterPage_Base.master"
    AutoEventWireup="true" CodeFile="BannerList.aspx.cs" Inherits="System_Other_BannerList" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    <link href="../Resources/Kindeditor/themes/default/default.css" rel="stylesheet"
        type="text/css" />

    <script src="../Resources/Kindeditor/kindeditor.js" type="text/javascript"></script>

    <script src="../Resources/Kindeditor/lang/zh_CN.js" type="text/javascript"></script>

    <script type="text/javascript">
        KindEditor.ready(function(K) {
            var editor = K.editor({
                uploadJson: '../Resources/Kindeditor/App/image_upload_json.ashx',
                fileManagerJson: '../Resources/Kindeditor/App/image_manager_json.ashx',
                allowFileManager: true
            });
            K('.ImgSrc .Button').click(function() {
                var td = K(this).parent();
                editor.loadPlugin('insertfile', function() {
                    editor.plugin.fileDialog({
                        fileUrl: K('input[type=hidden]', td).val(),
                        clickFn: function(url, title) {
                            K('img', td).attr("src", url);
                            K('input[type=hidden]', td).val(url);
                            editor.hideDialog();
                        }
                    });
                });
            });
        });
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Title" runat="Server">
    目录列表
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="Server">
    <table>
        <tr>
            <td>
                <table class="DataList" border="0" style="margin-top: 10px;">
                    <tr>
                        <th style="width: 200px;">
                            图片
                        </th>
                        <th style="width: 100px;">
                            标题
                        </th>
                        <th style="width: 200px;">
                            连接
                        </th>
                        <th style="width: 60px;">
                            排序
                        </th>
                        <th style="width: 80px;">
                            是否启用
                        </th>
                        <th style="width: 140px;">
                            操作
                        </th>
                    </tr>
                    <asp:Repeater ID="RepeaterList" runat="server" OnItemCommand="RepeaterList_ItemCommand"
                        OnItemDataBound="RepeaterList_ItemDataBound">
                        <ItemTemplate>
                            <tr>
                                <td class="ImgSrc" style="text-align: right;">
                                    <img src='<%# Eval("ImgSrc")%>' style="width: 200px; height: 60px; margin-top: 5px;
                                        margin-bottom: 5px; border: solid 1px gray; padding: 1px;" />
                                    <asp:Button ID="btn_ImgSrc" runat="server" Visible="false" Text="选择图片" CssClass="Button"
                                        Style="margin-top: -26px;" OnClientClick="return false" />
                                    <asp:HiddenField ID="hf_ImaSrc" runat="server" Value='<%# Eval("ImgSrc")%>' />
                                </td>
                                <td>
                                    <asp:Label ID="lab_Title" runat="server" Text='<%# Eval("Title")%>'></asp:Label>
                                    <asp:TextBox ID="txt_Title" runat="server" Visible="false" Text='<%# Eval("Title")%>'
                                        CssClass="TextBox"></asp:TextBox>
                                </td>
                                <td style="text-align: center;">
                                    <asp:Label ID="lab_LinkHref" runat="server" Text='<%# Eval("LinkHref")%>'></asp:Label>
                                    <asp:TextBox ID="txt_LinkHref" runat="server" Visible="false" Text='<%# Eval("LinkHref")%>'
                                        CssClass="TextBox" Width="160"></asp:TextBox>
                                </td>
                                <td style="text-align: center;">
                                    <asp:Label ID="lab_OrderNo" runat="server" Text='<%#Eval("OrderNo")%>'></asp:Label>
                                    <asp:TextBox ID="txt_OrderNo" runat="server" Visible="false" Text='<%#Eval("OrderNo")%>'
                                        CssClass="TextBox" Width="40"></asp:TextBox>
                                </td>
                                <td style="text-align: center;">
                                    <asp:Label ID="ValidText" runat="server" Text="启用"></asp:Label>
                                    <asp:LinkButton ID="BtnOperate" runat="server" CommandName="Valid" CommandArgument='<%#Eval("BannerId") %>'>修改</asp:LinkButton>
                                </td>
                                <td style="text-align: center;">
                                    <asp:LinkButton ID="lbtn_Modify" CommandName="Modify" runat="server">编辑</asp:LinkButton>
                                    <asp:LinkButton ID="lbtn_Update" CommandName="Update" CommandArgument='<%#Eval("BannerId") %>'
                                        runat="server" Visible="false">修改</asp:LinkButton>
                                    <asp:LinkButton ID="lbtn_Cancel" CommandName="Cancel" runat="server" Visible="false">取消</asp:LinkButton>
                                    <%--<a href='BannerModify.aspx?Action=Update&Id=<%#Eval("BannerId") %>'>编辑</a>--%>
                                    <asp:LinkButton ID="lbtn_Delete" CommandName="Delete" CommandArgument='<%#Eval("BannerId") %>'
                                        runat="server" OnClientClick="return isDelete()">删除</asp:LinkButton>
                                </td>
                            </tr>
                        </ItemTemplate>
                    </asp:Repeater>
                    <tr>
                        <td class="ImgSrc" style="text-align: right;">
                            <img src='<%# Eval("ImgSrc")%>' style="width: 200px; height: 60px; margin-top: 5px;
                                margin-bottom: 5px; border: solid 1px gray; padding: 1px; background-color: #EEEEEE;" />
                            <input type="button" value="选择图片" class="Button" style="margin-top: -26px;" />
                            <asp:HiddenField ID="hf_ImaSrc" runat="server" Value='' />
                        </td>
                        <td>
                            <asp:TextBox ID="txt_Title" runat="server" CssClass="TextBox" Width="100"></asp:TextBox>
                        </td>
                        <td style="text-align: center;">
                            <asp:TextBox ID="txt_LinkHref" runat="server" CssClass="TextBox" Width="160"></asp:TextBox>
                        </td>
                        <td style="text-align: center; width: 60px;">
                            <asp:TextBox ID="txt_OrderNo" runat="server" CssClass="TextBox" Width="40"></asp:TextBox>
                        </td>
                        <td>
                        </td>
                        <td style="text-align: center;">
                            <asp:LinkButton ID="lbtn_Add" runat="server" ValidationGroup="Check" OnClick="lbtn_Add_Click">新增</asp:LinkButton>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
